/**
 * creation: 20-mei-2008
 */
package org.jfonia.musicxml;

/**
 * Aux. class for dumping score info to console. 
 * 
 * @author wijnand.schepens@gmail.com
 *
 */
public class ScoreReporter
{
	public static void report1(Score score)
	{
            /*FIXME: UNCOMMENT
		for (Part part: score.getPartList())
		{
			System.out.println("---PART---");			
			Slice noteSlice = part.getNoteFamily().createSlice();
			Value<MusicalInterval> notePitch = noteSlice.getProperty("pitch");
			Value<CDuration> noteDuration = noteSlice.getProperty("duration");
			
			PitchNotationStyle pn = new StandardPitchNotationStyle();
			
			Node nproc = noteSlice.getProceeder();
			while (nproc.call(null))
			{
				MusicalInterval ival = notePitch.get();
				if (ival==null)
					System.out.print("rest");
				else
					System.out.print(pn.getName(ival));
				
				CDuration dur = noteDuration.get();
				System.out.print(":1/" + dur.getRecip());
				for (int i=0; i<dur.getDotCount(); i++)
					System.out.print(".");
				
				System.out.print(" ");
			}
			
			System.out.println();
		}
             */
	}
	
	
	public static void report2(Score score)
	{
            /*FIXME: UNCOMMENT
		for (Part part: score.getPartList())
		{
			System.out.println("---PART---");
			
			Slice noteSlice = part.getNoteFamily().createSlice();
			Value<MusicalInterval> notePitch = noteSlice.getProperty("pitch");
			Value<CDuration> noteDuration = noteSlice.getProperty("duration");
			
			Slice tupletStartSlice = part.getTupletFamily().createSlice();
			tupletStartSlice.getProperty("tuplet").addCallTarget(
					new Printer<String>(new SimpleValue<String>("start tuplet")));
			
			Reporter r = new Reporter();
			Value<Integer> noteTime = noteSlice.getKey("time");
			
			PitchNotationStyle pn = new StandardPitchNotationStyle();
			
//			Node nproc = noteSlice.getProceeder();
//			Node tsproc = tupletStartSlice.getProceeder();
			
			Node proc = ParallelIteration.createParallelProceeder(noteSlice, "time", tupletStartSlice, "startTime");
			while (proc.call(null))
			{
				//r.report(noteTime);
				
				MusicalInterval ival = notePitch.get();
				if (ival==null)
					System.out.print("rest");
				else
					System.out.print(pn.getName(ival));
				
				CDuration dur = noteDuration.get();
				System.out.print(":1/" + dur.getRecip());
				for (int i=0; i<dur.getDotCount(); i++)
					System.out.print(".");
				
				System.out.print(" ");
			}
			
			System.out.println();
		}
             */
	}
}
